package com.syyo.common.utils;

import java.util.Collection;
import java.util.List;

/**
 * @Auther: wangzhong
 * @Date: 2019/10/16 18:35
 * @Description:
 */
public class MyListUtils {

    /**
     * 校验集合是否为空
     *
     * @param list
     * @return
     */
    public static boolean isEmpty(Collection<?> list) {
        if (list != null && list.size() > 0) {
            return false;
        } else {
            return true;
        }
    }

    public static boolean isNotEmpty(Collection<?> list) {
        if (list != null && list.size() > 0) {
            return true;
        } else {
            return false;
        }
    }

    public static String listToString(List<Integer> list) {
        String end = "";
        for (Integer o : list) {
            end = end + "," + o;
        }
        return end.substring(1, end.length());
    }
}
